/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-07-13
 * Time: 16:17
 */
public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        binaryTree.size(root);
        System.out.println("树中节点个数(size1):"+BinaryTree.nodeSize);
        System.out.println("树中节点个数(size2):"+binaryTree.size2(root));
        binaryTree.getLeafNodeCount1(root);
        System.out.println("树中叶子节点个数(遍历):"+BinaryTree.leafSize);
        System.out.println("树中叶子节点个数(子问题):"+binaryTree.getLeafNodeCount2(root));
        System.out.println("第k层节点个数:"+binaryTree.getKLevelNodeCount(root,1));
        System.out.println("二叉树的高度:"+binaryTree.getHeight(root));
        BinaryTree.TreeNode node = binaryTree.find(root,'D');
        System.out.println(node.val);
        System.out.println("==========");
        binaryTree.levelOrder(root);
        System.out.println("==========");
        System.out.println(binaryTree.isCompleteTree(root));
    }
}
